package com.kamenrider.adventureaffiliated.procedures;

import net.minecraftforge.registries.ForgeRegistries;

import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.core.particles.ParticleTypes;

public class BasketballeffectsDangWanJiaYuGaiShiTiFaShengPengZhuangShiProcedure {
	public static void execute(LevelAccessor world, double x, double y, double z, Entity entity, Entity sourceentity) {
		if (entity == null || sourceentity == null)
			return;
		if (!((ForgeRegistries.ENTITIES.getKey(sourceentity.getType()).toString()).equals("rider_adventure_affiliated:another_build_2017")
				|| (ForgeRegistries.ENTITIES.getKey(sourceentity.getType()).toString()).equals("rider_adventure_affiliated:another_build_2019"))) {
			if (world instanceof ServerLevel _level)
				_level.sendParticles(ParticleTypes.EXPLOSION, x, y, z, 1, 0.2, 0.2, 0.2, 0.1);
			entity.setNoGravity((true));
			sourceentity.hurt(DamageSource.LAVA, 30);
			if (entity instanceof LivingEntity _entity)
				_entity.setHealth(0);
		}
	}
}
